<?php

$arr[] = array('Id','Name','Email');
$arr[] = array('1','Amit','amyroks@gmail.com');
$arr[] = array('2','Sunil','sunil@gmail.com');
$arr[] = array('3','Pankaj','powerofpankaj@ymail.com');
$arr[] = array('4','Jaya','jaya@gmail.com');
print_r($arr);

$fp = fopen('users2.csv','w+');
//var_dump($fp);
foreach ($arr as $val) {
  fputcsv($fp, $val , ',');
}
fclose($fp);
